<template>
    <div class="">
        <button @click="getMsg('1',$event)">获取事件对象1</button><br/>
        <button @click="getMsg('2',$event)">获取事件对象2</button><br/>
        <h1>{{ count }}</h1>
        <button @click="addCount($event)">新增count的值</button>
    </div>
</template>

<script setup>
import { ref } from 'vue';
const getMsg = (type,event)=>{
    console.log(type,event.target)
}
let count = ref(0)
let addCount = (event) =>{
    count.value++
    console.log(event.target);
    if(count.value%2==0){
        event.target.style.border = "3px dotted"
    }else{
        event.target.style.border = "3px solid"
    }
}
</script>

<style scoped></style>